var _initQuerySelectorAll = function () {
    if (!document.querySelectorAll) {
        document.querySelectorAll = function (selectors) {
            var style = document.createElement('style'), elements = [], element;
            document.documentElement.firstChild.appendChild(style);
            document._qsa = [];
            style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
            window.scrollBy(0, 0);
            style.parentNode.removeChild(style);
            while (document._qsa.length) {
                element = document._qsa.shift();
                element.style.removeAttribute('x-qsa');
                elements.push(element);
            }
            document._qsa = null;
            return elements;
        };
    }
    if (!document.querySelector) {
        document.querySelector = function (selectors) {
            var elements = document.querySelectorAll(selectors);
            return (elements.length) ? elements[0] : null;
        };
    }
};

var AssertUtils = {
    isString: function (source) {
        return '[object String]' == Object.prototype.toString.call(source);
    },
    isFunction: function (funcStr) {
        if (AssertUtils.isNotNull(funcStr)) {
            if (typeof funcStr == "function") {
                return true;
            }
            else {
                return false;
            }
        }
    }, isObject: function (funcStr) {
        if (funcStr != null && typeof funcStr == "object") {
            return true;
        }
        else {
            return false;
        }
    }, isNotNull: function (funcStr) {
        if (funcStr != null && typeof funcStr != undefined && typeof funcStr != null) {
            return true;
        }
        else {
            return false;
        }
    }, isNotEmpty: function (funcStr) {
        if (funcStr != null && typeof funcStr != undefined && funcStr !== "") {
            return true;
        }
        else {
            return false;
        }
    }, isUrl: function (urlStr) {
        if (typeof urlStr !== "undefined" && urlStr.indexOf("/")) {
            return true;
        }
        else {
            return false;
        }
    }, isArray: function (par) {
        if (typeof par === "object" && typeof par.slice === "function" && typeof par.sort === "function" && typeof par.length === "number" && !par.propertyIsEnumerable(par.length)) {
            return true;
        }
        else {
            return false;
        }
    }, isNumber: function (value) {
        return (parseFloat(value) == value);
    }
};

function showHide(obj, targetObj) {
    obj.click(function () {
        targetObj.toggle();
    });
}
function getFirstDateOfWeek(theDate) {
    var firstDateOfWeek = new Date(theDate.getTime());
    if (theDate.getDay() == 0) {
        firstDateOfWeek.setDate(theDate.getDate() - 6);
    }
    else {
        firstDateOfWeek.setDate(theDate.getDate() - theDate.getDay() + 1);
    }
    return firstDateOfWeek;
}
function getLastDateOfWeek(theDate) {
    var lastDateOfWeek = new Date(theDate.getTime());
    if (theDate.getDay() != 0) {
        lastDateOfWeek.setDate(theDate.getDate() + 6 - theDate.getDay() + 1);
    }
    return lastDateOfWeek;
}
var MonHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function getLastDateOfMonth(year, month) {
    var n = MonHead[month - 1];
    if (month == 2 && IsPinYear(year)) {
        n++;
    }
    return n;
}
function IsPinYear(year) {
    return (0 == year % 4 && (year % 100 != 0 || year % 400 == 0));
}
function mouseBind(detail, _this, cardMini, pId, layerEl, backFun) {
    function showDailog(e) {
        var eve = e || window.e;
        var targ = eve.target || eve.srcElement;
        if (targ.nodeType == 3)
            targ = targ.parentNode;
        var _set = detail.offset();
        var elHeight = targ.style.height;
        if (_set != null) {
            var thisElObj = _this;
            if (_this != null && _this.get != null) {
                thisElObj = _this.get(0);
            }
            var inArea = (e.clientX > _set.left && e.clientX < (_set.left + cardMini.width) && e.clientY < (_set.top + cardMini.height) && e.clientY > (_set.top - SeeUtils.getElHeight(thisElObj))) ||
                (e.clientX > _set.left && e.clientX < (_set.left + detail.width()) && e.clientY < (_set.top + detail.height()) && e.clientY > (_set.top - SeeUtils.getElHeight(thisElObj)));
        }
        if (targ != _this && !inArea && targ.id != pId) {
            var flag = cardMini.hideDialog(layerEl);
            if (flag) {
                SeeUtils.removeEvent(document, 'mouseover', showDailog);
                if (AssertUtils.isNotNull(backFun)) {
                    backFun();
                }
            }
        }
    }
    SeeUtils.addEvent(document, 'mouseover', showDailog);
}
function setAttachmentsLayoutHeight(json) {
    if (SeeUtils.isIE) {
        if (SeeUtils.isIE6) {
            var els = SeeUtils.getByClass(document, "affix_area");
            for (var num = 0; num < els.length; num++) {
                var elObj = els[num];
                if (parseFloat(elObj.style.height) > 34) {
                    elObj.style.height = 34 + "px";
                }
            }
        }
    }
    var _fj_id = document.getElementById(json.fj_id);
    var _wd_id = document.getElementById(json.wd_id);
    var _layout_h = document.getElementById(json.layout_head_id);
    var _layout_b = document.getElementById(json.layout_body_id);
    var _height = 0, _rowNum = 0, _w1 = 0, _w2 = 0, _attachment_block_number_w = 20;
    _w1 += SeeUtils.getClassElWidth(json.fj_id, "attachment_block_number");
    _w1 += SeeUtils.getAllWidth(json.fj_id, "attachment_block");
    _w2 += SeeUtils.getClassElWidth(json.wd_id, "attachment_block_number");
    _w2 += SeeUtils.getAllWidth(json.wd_id, "attachment_block");
    if (_w1 > SeeUtils.getElWidth(_fj_id)) {
        _rowNum += 2;
    }
    else if (_w1 > _attachment_block_number_w) {
        _rowNum += 1;
    }
    if (_w2 > SeeUtils.getElWidth(_wd_id)) {
        _rowNum += 2;
    }
    else if (_w2 > _attachment_block_number_w) {
        _rowNum += 1;
    }
    SeeUtils.setElHeight(_layout_h, SeeUtils.getElHeight(_layout_b) + _rowNum * 17);
    if (AssertUtils.isNotEmpty(SeeUtils.getCss(_layout_b, "top"))) {
        SeeUtils.css(_layout_b, "top", parseFloat(SeeUtils.getCss(_layout_b, "top")) + _rowNum * 17 + "px");
    }
}
function set_select_val(sel, val) {
    if (SeeUtils.isIE6) {
        setTimeout(function () {
            sel.val(val);
        }, 1);
    }
    else {
        try {
            sel.val(val);
        }
        catch (e) {
            setTimeout(function () {
                sel.val(val);
            }, 1);
        }
    }
}

function _GoTo_Top_ClickFn(obj, _btnClass) {
    var GoToTopObj = __GoTo_Top_Array__[_btnClass];
    if (GoToTopObj) {
        if ($("#content_view_div").length > 0) {
            $("#content_view_div").stop().animate({
                scrollTop: GoToTopObj._nGoToHeight
            }, "fast");
        }
        else if ($("#compontentHtml").length > 0) {
            $("#compontentHtml").stop().animate({
                scrollTop: GoToTopObj._nGoToHeight
            }, "fast");
        }
        else {
            $("body").stop().animate({
                scrollTop: GoToTopObj._nGoToHeight
            }, "fast");
        }
    }
}
var __GoTo_Top_Array__ = {};
function GoTo_Top(json) {
    if (json == null) {
        var json = {};
    }
    var elItemWidth = "41px";
    json["elItemWidth"] = elItemWidth;
    var _id = json.id ? json.id : "GoTo_Top_" + Math.floor(Math.random() * 100000000);
    var windowHeight = SeeUtils.getWindowHeight();
    var _btnClass = json.btnClass ? json.btnClass : "GoTo_Top";
    var _showHeight = json.showHeight ? json.showHeight : windowHeight;
    var _marginLeft = json.marginLeft ? json.marginLeft : 798;
    this._nGoToHeight = json.nGoToHeight ? json.nGoToHeight : 0;
    var _title = json.sTitle ? json.sTitle : SeeUtils.getLabel("goToTop");
    if (json.id === 'openOtherMenu') {
        _title = SeeUtils.getLabel("proAss");
    }
    var _this = this;
    if (_btnClass != null && _btnClass != 'goToOtherMenu' && _btnClass != 'GoTo_Top2') {
        var iframeObj = document.createElement("iframe");
        iframeObj.className = _btnClass + "_iframe";
        iframeObj.setAttribute("scrolling", 'no');
        iframeObj.setAttribute("border", '0');
        if (_btnClass != "GoTo_Top") {
            iframeObj.style.marginLeft = (_marginLeft / 2) + "px";
        }
        SeeUtils.prependToBody(iframeObj);
    }
    var aLinkNode = document.createElement("a");
    aLinkNode.id = _id;
    aLinkNode.className = _btnClass;
    aLinkNode.setAttribute("href", 'javascript:void(0)');
    aLinkNode.setAttribute("title", _title);
    if (_btnClass != 'goToOtherMenu') {
        SeeUtils.prependToBody(aLinkNode);
    }
    if (json.left !== undefined && (_btnClass === "GoTo_Top" || _btnClass === "GoTo_Top2" || _btnClass === "goToReply")) {
        aLinkNode.style.left = json.left + "px";
    }
    if (_btnClass == 'goToReply') {
        aLinkNode.style.display = "inline";
        aLinkNode.style.bottom = "18px";
    }
    SeeUtils.addEvent(_id, 'click', function () {
        _GoTo_Top_ClickFn(this, _btnClass);
    });
    if (_btnClass == 'GoTo_Top') {
        if ($("#content_view_div").length > 0) {
            $("#content_view_div").scroll(function () {
                if ($(".content_view").scrollTop() > 0) {
                    SeeUtils.showElByClass(".GoTo_Top");
                    SeeUtils.showElByClass(".GoTo_Top_iframe");
                }
                else {
                    SeeUtils.hideElByClass(".GoTo_Top");
                    SeeUtils.hideElByClass(".GoTo_Top_iframe");
                }
            });
        }
        else {
            var _obj = $(window);
            _obj.scroll(function () {
                if (_obj.scrollTop() > 0) {
                    SeeUtils.showElByClass(".GoTo_Top");
                    SeeUtils.showElByClass(".GoTo_Top_iframe");
                }
                else {
                    SeeUtils.hideElByClass(".GoTo_Top");
                    SeeUtils.hideElByClass(".GoTo_Top_iframe");
                }
            });
        }
    }
    __GoTo_Top_Array__[_btnClass] = this;
    if (document.querySelector(".GoTo_Top2") != null) {
        SeeUtils.showElByClass(".GoTo_Top2");
        SeeUtils.showElByClass(".GoTo_Top2_iframe");
    }
}
GoTo_Top.prototype.setGoToHeight = function (n) {
    this._nGoToHeight = n;
};

function inputChange(obj, text, color) {
    var _this = this;
    _this.obj = obj;
    _this.color = color;
    if (obj.val() == "") {
        if (!(_this.color)) {
            _this.color = "color_gray";
        }
        ;
    }
    _this.text = text;
    if (!(_this.text)) {
        _this.text = $.i18n('seeyon.ui.common.printCap4.tips');
    }
    _this.change();
}
inputChange.prototype.change = function () {
    with (this) {
        check();
        obj.focus(function () {
            if (obj.hasClass(color)) {
                obj.removeClass(color).val("");
            }
        });
        obj.blur(function () {
            if (obj.val() == "") {
                obj.addClass(color).val(text);
            }
        });
    }
};
inputChange.prototype.check = function () {
    with (this) {
        if (obj.val() == "" || obj.val() == text) {
            obj.addClass(color).val(text);
        }
        else {
            obj.removeClass(color);
        }
    }
};
SeeUtils.ready(function () {
    SeeUtils.addEvent("condition", 'change', function () {
        var value_str = SeeUtils.getElVal("condition");
        SeeUtils.hideElByClass(".condition_text");
        SeeUtils.showEl(value_str + 'Div');
    });
});

var plist = null;
var printObj = {};
function printCap4(printUrl, printType, params) {
    printObj = params;
    var printFragmentList = new ArrayList();
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.title'), dataHtml: "", hide: true });
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.information'), dataHtml: "", hide: true });
    if (AssertUtils.isNotEmpty(printUrl)) {
        printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.text'), dataHtml: printUrl });
    }
    else {
        printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.text'), dataHtml: window.window.location.href, hide: true });
    }
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.enclosure'), dataHtml: "", hide: true });
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.documents'), dataHtml: "", hide: true });
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.synergies'), dataHtml: "", hide: true });
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.appendix'), dataHtml: "", hide: true });
    printFragmentList.add({ dataName: $.i18n('seeyon.ui.common.printCap4.opinion'), dataHtml: "", hide: true });
    plist = printFragmentList;
    var url = _ctxPath + "/common/print/captPrintForm.jsp?printType=cap4Print";
    url += "&printUrl=" + printUrl;
    window.open(url);
}

var SeeUtils = {
    getPageY: function (event) {
        var a = "1234";
        return event.y ? event.y : event.pageY;
    },
    getPageX: function (event) {
        return event.x ? event.x : event.pageX;
    },
    trim: function (text) {
        var chs = text.toCharArray();
        var st = 0;
        var off = chs.length;
        for (var i = 0; i < chs.length; i++) {
            var c = chs[i];
            if (c == ' ') {
                st++;
            }
            else {
                break;
            }
        }
        if (st == text.length) {
            return "";
        }
        for (var i2 = chs.length; i2 > 0; i2--) {
            var c = chs[i2 - 1];
            if (c == ' ') {
                off--;
            }
            else {
                break;
            }
        }
        return text.substring(st, off);
    },
    eventHandler: {},
    beforeEL: function (targetEl, curEl) {
        targetEl = SeeUtils.getElObj(targetEl);
        curEl = SeeUtils.getElObj(curEl);
        $(targetEl).before(curEl);
    },
    afterEL: function (targetEl, curEl) {
        targetEl = SeeUtils.getElObj(targetEl);
        curEl = SeeUtils.getElObj(curEl);
        $(targetEl).after(curEl);
    },
    executeCusEvent: function (envetId, aElObj) {
        if (AssertUtils.isNotEmpty((envetId))) {
            var envetAry = envetId.split(';');
            for (var num = 0; num < envetAry.length; num++) {
                if (typeof SeeUtils.eventHandler[envetAry[num]] == "function") {
                    SeeUtils.eventHandler[envetAry[num]](aElObj);
                }
            }
        }
    },
    isVisible: function (aElObj) {
        aElObj = SeeUtils.getElObj(aElObj);
        if (aElObj != null) {
            if (aElObj.style.display != "none") {
                return true;
            }
        }
        return false;
    },
    getLabel: function (aElObj) {
        aElObj = SeeUtils.getElObj(aElObj);
        if (aElObj != null) {
            return aElObj.innerText;
        }
        else {
            return "";
        }
    },
    executeMouseenter: function (aElObj) {
        aElObj = SeeUtils.getElObj(aElObj);
        var envetId = SeeUtils.getAttrEl(aElObj, "mouseenterid");
        SeeUtils.executeCusEvent(envetId, aElObj);
    },
    executeMouseleave: function (aElObj) {
        aElObj = SeeUtils.getElObj(aElObj);
        var envetId = SeeUtils.getAttrEl(aElObj, "mouseleaveid");
        SeeUtils.executeCusEvent(envetId, aElObj);
    },
    executeClick: function (aElObj) {
        aElObj = SeeUtils.getElObj(aElObj);
        SeeUtils.triggerClick(aElObj);
    },
    toggleClass: function (elObj, className) {
        elObj = SeeUtils.getElObj(elObj);
        if (SeeUtils.hasClass(elObj, className)) {
            SeeUtils.removeClass(elObj, className);
        }
        else {
            SeeUtils.addClass(elObj, className);
        }
    },
    triggerClick: function (el) {
        if (el.click) {
            el.click();
        }
        else {
            try {
                var evt = document.createEvent('Event');
                evt.initEvent('click', true, true);
                el.dispatchEvent(evt);
            }
            catch (e) {
            }
        }
    },
    isOpera: (navigator.userAgent.indexOf("Opera") > -1),
    isFF: (navigator.userAgent.indexOf("Firefox") > -1),
    isSafari: (navigator.userAgent.indexOf("Safari") > -1),
    isIE: (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0),
    isIE6: (window.XMLHttpRequest == null && navigator.userAgent.indexOf("MSIE") >= 0),
    isIE7: (navigator.userAgent.indexOf("MSIE 7.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0),
    isIE8: (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0) && /msie 8\.0/i.test(navigator.userAgent) || (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0) && /msie 7\.0/i.test(navigator.userAgent),
    isIE9: (navigator.userAgent.indexOf("MSIE 9.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0),
    isIE10: (navigator.userAgent.indexOf("MSIE 10.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0),
    isIE11: (navigator.userAgent.indexOf("MSIE 11.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0 || navigator.userAgent.indexOf("rv:11.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0),
    getElObj: function (curNode, winObj) {
        if (curNode != null) {
            if (winObj != null) {
                if (typeof curNode == 'string' || typeof curNode == 'number') {
                    curNode = winObj.document.getElementById(curNode + "");
                }
            }
            else {
                if (typeof curNode == 'string' || typeof curNode == 'number') {
                    curNode = document.getElementById(curNode + "");
                }
            }
            return curNode;
        }
        else {
            return null;
        }
    },
    getSizeById: function (elId, winObj) {
        var node = null;
        if (winObj != null) {
            node = winObj.document.getElementById(elId);
        }
        else {
            node = document.getElementById(elId);
        }
        if (node != null) {
            return 1;
        }
        else {
            return 0;
        }
    },
    eachChildren: function (elObj, backFun) {
        elObj = SeeUtils.getElObj(elObj);
        if (elObj != null) {
            for (var num = 0; num < elObj.children.length; num++) {
                if (backFun != null && AssertUtils.isFunction(backFun)) {
                    backFun(elObj.children[num]);
                }
            }
            return elObj.children;
        }
        return [];
    },
    eachAllSonElsByClass: function (className, callback) {
        function _addSonEls(topEl, els) {
            var clds = topEl.childNodes;
            for (var num = 0; num < clds.length; num++) {
                var cldEl = clds[num];
                if (cldEl != null) {
                    els.push(cldEl);
                    _addSonEls(cldEl, els);
                }
            }
        }
        var els = [];
        var topEls = SeeUtils.getByClass(document, className);
        for (var num = 0; num < topEls.length; num++) {
            var topEl = topEls[num];
            els.push(topEl);
            _addSonEls(topEl, els);
        }
        for (var selNums = 0; selNums < els.length; selNums++) {
            var selecteElObj = els[selNums];
            typeof callback == "function" && callback(selecteElObj, selNums);
        }
    },
    siblings: function (curElObj, tagName, callback) {
        curElObj = SeeUtils.getElObj(curElObj);
        if (curElObj == null) {
            return void (0);
        }
        var siblingElement = [];
        var parentAllElement = [];
        if (!curElObj.parentNode) {
            return siblingElement;
        }
        parentAllElement = curElObj.parentNode.childNodes;
        for (var i = 0; i < parentAllElement.length; i++) {
            if (parentAllElement[i] != curElObj && parentAllElement[i].nodeType === 1 && curElObj.tagName === tagName.toUpperCase()) {
                siblingElement.push(parentAllElement[i]);
                if (AssertUtils.isFunction(callback)) {
                    callback(parentAllElement[i]);
                }
            }
        }
    },
    getSizeByClass: function (className, winObj) {
        if (winObj != null) {
            var els = SeeUtils.getByClass(winObj.document, className);
            return els.length;
        }
        else {
            return SeeUtils.getByClass(document, className).length;
        }
    },
    getFirstElByClass: function (className, winObj, parentNode) {
        var els = [];
        if (winObj != null) {
            els = SeeUtils.getByClass(winObj.document, className);
        }
        else {
            if (parentNode == null) {
                parentNode = document;
            }
            els = SeeUtils.getByClass(parentNode, className)[0];
        }
        if (els.length > 0) {
            return els[0];
        }
    },
    removeElByClass: function (className, winObj) {
        if (winObj != null) {
            return SeeUtils._removeElByClass(winObj.document, className);
        }
        else {
            return SeeUtils._removeElByClass(document, className);
        }
    },
    _removeElByClass: function (oParent, className) {
        var aResult = [];
        var aEles = SeeUtils.getByClass(oParent, className);
        if (className.indexOf(".") == 0) {
            className = className.substring(1, className.length);
        }
        for (var i = 0; i < aEles.length; i++) {
            if (aEles[i].className != null && aEles[i].className.indexOf(className) >= 0) {
                SeeUtils.removeEl(aEles[i]);
            }
        }
    },
    _getObjType: function (object) {
        try {
            if (StaticNodeList && object.constructor == StaticNodeList) {
                return 'StaticNodeList';
            }
        }
        catch (e) { }
        switch (object.constructor) {
            case Object:
                return 'Object';
                break;
            case Array:
                return 'Array';
                break;
            case NodeList:
                return 'NodeList';
                break;
            default:
                return 'null';
                break;
        }
    },
    each: function (object, callback) {
        var type = SeeUtils._getObjType(object);
        if (type === 'Array' || type === 'NodeList' || type === 'StaticNodeList') {
            if (!Array.prototype.every) {
                Array.prototype.every = function (fun) {
                    'use strict';
                    if (this === void 0 || this === null)
                        throw new TypeError();
                    var t = Object(this);
                    var len = t.length >>> 0;
                    if (typeof fun !== 'function')
                        throw new TypeError();
                    var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
                    for (var i = 0; i < len; i++) {
                        if (i in t && !fun.call(thisArg, t[i], i, t))
                            return false;
                    }
                    return true;
                };
            }
            [].every.call(object, function (v, i) {
                return callback.call(v, i, v) === false ? false : true;
            });
        }
        else if (type === 'Object') {
            for (var i in object) {
                if (callback.call(object[i], i, object[i]) === false) {
                    break;
                }
            }
        }
    },
    getElByTag: function (oParent, tagName) {
        oParent = SeeUtils.getElObj(oParent);
        if (oParent != null) {
            var allElement = oParent.getElementsByTagName(tagName);
            return allElement;
        }
        return [];
    },
    _getParents: function (orgs, nodeEl, className) {
        if (nodeEl != null) {
            if (SeeUtils.hasClass(nodeEl, className)) {
                orgs.push(nodeEl);
            }
        }
        if (nodeEl != null) {
            SeeUtils._getParents(orgs, nodeEl.parentNode, className);
        }
    },
    getParentsByClass: function (node, className) {
        if (className.indexOf(".") == 0) {
            className = className.substring(1, className.length);
        }
        var orgs = [];
        SeeUtils._getParents(orgs, node, className);
        return orgs;
    },
    _closestEl: function (node, _tagName) {
        if (node != null) {
            if (node.tagName === _tagName.toUpperCase()) {
                return node;
            }
            else {
                return SeeUtils._closestEl(node.parentNode, _tagName);
            }
        }
        return null;
    },
    _closestElByClass: function (node, className) {
        if (node != null) {
            if (SeeUtils.hasClass(node, className)) {
                return node;
            }
            else {
                return SeeUtils._closestElByClass(node.parentNode, className);
            }
        }
        return null;
    },
    closestByClass: function (node, className) {
        var clNameAry = (className + "").split(".");
        className = clNameAry[0];
        if (clNameAry.length > 0) {
            className = clNameAry[1];
        }
        node = SeeUtils.getElObj(node);
        if (node != null) {
            return SeeUtils._closestElByClass(node.parentNode, className);
        }
        return null;
    },
    closestByTagName: function (node, tagName) {
        node = SeeUtils.getElObj(node);
        if (node != null) {
            if (node.tagName === tagName.toUpperCase()) {
                return node;
            }
            return SeeUtils._closestEl(node.parentNode, tagName);
        }
        return null;
    },
    eachElsByTagAndProp: function (oParent, tagName, propName, propValue, callBack) {
        var inputElsAry = [];
        oParent = SeeUtils.getElObj(oParent);
        if (oParent != null) {
            var inputEls = SeeUtils.getElByTag(oParent, tagName);
            for (var num = 0; num < inputEls.length; num++) {
                var inputElObj = inputEls[num];
                if (SeeUtils.getAttrEl(inputElObj, propName) === propValue) {
                    inputElsAry.push(inputElObj);
                    if (callBack != null && AssertUtils.isFunction(callBack)) {
                        callBack(inputElObj, num);
                    }
                }
            }
        }
        return inputElsAry;
    },
    getCheckedInpus: function (oParent) {
        var inputElsAry = [];
        oParent = SeeUtils.getElObj(oParent);
        if (oParent != null) {
            var inputEls = SeeUtils.getElByTag(oParent, "input");
            for (var num = 0; num < inputEls.length; num++) {
                var inputElObj = inputEls[num];
                if (inputElObj.checked)
                    inputElsAry.push(inputElObj);
            }
        }
        return inputElsAry;
    },
    getNextEl: function (node) {
        var nextNode = null;
        if (SeeUtils.isIE8) {
            nextNode = node.nextSibling;
        }
        else {
            nextNode = node.nextElementSibling;
        }
        if (nextNode) {
            if (nextNode.nodeType === 1) {
                return nextNode;
            }
        }
        else {
            return null;
        }
    },
    getPrevEle: function (node) {
        var preNode = node.previousSibling;
        if (preNode) {
            if (preNode.nodeType === 1) {
                return preNode;
            }
            if (preNode.previousSibling) {
                return arguments.callee(preNode);
            }
        }
        else {
            return null;
        }
    },
    eachBySiblings: function (elObj, cllback) {
        var siblingElement = [];
        var parentAllElement = [];
        if (!elObj.parentNode) {
            return siblingElement;
        }
        ;
        parentAllElement = elObj.parentNode.childNodes;
        for (var i = 0; i < parentAllElement.length; i++) {
            if (parentAllElement[i] != elObj && parentAllElement[i].nodeType === 1) {
                siblingElement.push(parentAllElement[i]);
                if (AssertUtils.isFunction(cllback)) {
                    cllback(parentAllElement[i]);
                }
            }
        }
        return siblingElement;
    },
    eachByTag: function (oParent, tagName, callback) {
        var selecteEls = SeeUtils.getElByTag(oParent, tagName);
        for (var selNums = 0; selNums < selecteEls.length; selNums++) {
            var selecteElObj = selecteEls[selNums];
            typeof callback == "function" && callback(selecteElObj, selNums);
        }
    },
    eachByClass: function (oParent, className, callback) {
        var btnEls = SeeUtils.getByClass(oParent, className);
        for (var btnNums = 0; btnNums < btnEls.length; btnNums++) {
            typeof callback == "function" && callback(btnEls[btnNums], btnNums);
        }
    },
    isElement: function (obj) {
        return !!(obj && (obj.nodeType == 1 || obj.nodeType == 9));
    },
    getByClass: function (oParent, className) {
        oParent = SeeUtils.getElObj(oParent);
        if (oParent == null) {
            return [];
        }
        if (className.indexOf(".") != 0) {
            className = "." + className;
        }
        if (oParent == null) {
            return [];
        }
        if (className.indexOf(".") != 0) {
            className = "." + className;
        }
        if (SeeUtils.isIE8) {
            _initQuerySelectorAll();
            if (oParent.querySelectorAll) {
                var els = oParent.querySelectorAll(className);
                return els;
            }
            else {
                var res = [];
                var re = new RegExp(' ' + className + ' ', 'i');
                var aEle = oParent.getElementsByTagName('*');
                for (var i = 0; i < aEle.length; i++) {
                    if (re.test(' ' + aEle[i].className + ' ')) {
                        res.push(aEle[i]);
                    }
                }
                return res;
            }
        }
        else {
            var els = oParent.querySelectorAll(className);
            return els;
        }
    },
    hasClass: function (obj, cls) {
        obj = SeeUtils.getElObj(obj);
        if (obj == null) {
            return void (0);
        }
        if (obj.className != null) {
            var falg = obj.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
            if (falg == null) {
                return false;
            }
            else {
                return true;
            }
        }
        else {
            return false;
        }
    },
    addClass: function (obj, cls) {
        obj = SeeUtils.getElObj(obj);
        if (obj == null) {
            return void (0);
        }
        if (!SeeUtils.hasClass(obj, cls))
            obj.className += " " + cls;
    },
    removeClass: function (obj, cls) {
        obj = SeeUtils.getElObj(obj);
        if (SeeUtils.hasClass(obj, cls)) {
            var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
            obj.className = obj.className.replace(reg, ' ');
        }
    },
    getInnerWidth: function (elObj) {
        var elObjH = parseFloat(SeeUtils.getElWidth(elObj))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingLeft")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingRight")));
        return elObjH;
    },
    getOuterWidth: function (elObj) {
        var elObjH = parseFloat(SeeUtils.getElWidth(elObj))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "borderLeftWidth")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "borderRightWidth")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingLeft")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingRight")));
        return elObjH;
    },
    getInnerHeight: function (elObj) {
        var elObjH = parseFloat(SeeUtils.getElHeight(elObj))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingTop")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingBottom")));
        return elObjH;
    },
    getOuterHeight: function (elObj) {
        var elObjH = parseFloat(SeeUtils.getElHeight(elObj))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "borderTopWidth")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "borderBottomWidth")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingTop")))
            + parseFloat(SeeUtils.getNumber(SeeUtils.getCss(elObj, "paddingBottom")));
        return elObjH;
    },
    getElWidth: function (elObj) {
        elObj = SeeUtils.getElObj(elObj);
        if (elObj != null && SeeUtils.isShow(elObj)) {
            if (elObj.style.width != null && elObj.style.width.length > 0 && elObj.style.width != 'auto' && (elObj.style.width + "").indexOf("%") == -1) {
                return parseFloat(elObj.style.width);
            }
            if (parseFloat(SeeUtils._getStyleValue(elObj, "width")) > 0 && SeeUtils._getStyleValue(elObj, "width").indexOf("%") == -1) {
                return parseFloat(SeeUtils._getStyleValue(elObj, "width"));
            }
            if (elObj.offsetWidth > 0) {
                var borderLeftWidth = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "borderLeftWidth"));
                var borderRightWidth = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "borderRightWidth"));
                var paddingLeft = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "paddingLeft"));
                var paddingRight = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "paddingRight"));
                var backWidth = parseFloat(elObj.offsetWidth) - parseFloat(borderLeftWidth) - parseFloat(borderRightWidth) - parseFloat(paddingLeft) - parseFloat(paddingRight);
                return parseFloat(backWidth + '');
            }
            return 0;
        }
        else if (elObj != null) {
            var oldStyle = elObj.getAttribute("style");
            SeeUtils.attrEl(elObj, 'style', "visibility:hidden;display:inline-block !important;" + oldStyle);
            var width = SeeUtils.getElWidth(elObj);
            SeeUtils.attrEl(elObj, 'style', oldStyle);
            return Math.ceil(width);
        }
        else {
            return 0;
        }
    },
    getDocumentHeight: function () {
        return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
    },
    getDocumentWidth: function () {
        return document.documentElement.scrollWidth;
    },
    getStyle: function (element, att) {
        if (window.getComputedStyle) {
            return window.getComputedStyle(element)[att];
        }
        else {
            return element.currentStyle[att];
        }
    },
    getElOffest: function (node) {
        node = SeeUtils.getElObj(node);
        function _isWindow(obj) {
            return obj != null && obj == obj.window;
        }
        ;
        function getWindow(elem) {
            return _isWindow(elem) ?
                elem :
                elem.nodeType === 9 ?
                    elem.defaultView || elem.parentWindow :
                    false;
        }
        var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, box = { top: 0, left: 0 }, elem = node, doc = elem && elem.ownerDocument;
        if (!doc) {
            return;
        }
        if ((body = doc.body) === elem) {
            return SeeUtils.bodyOffset(elem);
        }
        docElem = doc.documentElement;
        if (typeof elem.getBoundingClientRect !== "undefined") {
            box = elem.getBoundingClientRect();
        }
        win = getWindow(doc);
        clientTop = docElem.clientTop || body.clientTop || 0;
        clientLeft = docElem.clientLeft || body.clientLeft || 0;
        scrollTop = win.pageYOffset || docElem.scrollTop;
        scrollLeft = win.pageXOffset || docElem.scrollLeft;
        return {
            top: box.top + scrollTop - clientTop,
            left: box.left + scrollLeft - clientLeft
        };
    },
    offset: function (target) {
        var top = 0, left = 0;
        while (target.offsetParent) {
            top += target.offsetTop;
            left += target.offsetLeft;
            target = target.offsetParent;
        }
        return {
            top: top,
            left: left
        };
    },
    bodyOffset: function (body) {
        var top = body.offsetTop, left = body.offsetLeft;
        return { top: top, left: left };
    },
    getWidthByClass: function (className, winObj) {
        var els = SeeUtils.getByClass(winObj.document, className);
        if (els.length > 0) {
            return SeeUtils.getElWidth(els[0]);
        }
        else {
            return 0;
        }
    },
    getClassElWidth: function (parentElId, className) {
        var els = SeeUtils.getByClass(document.getElementById(parentElId), className);
        if (els.length > 0) {
            return SeeUtils.getElWidth(els[0]);
        }
        else {
            return 0;
        }
    },
    getAllWidth: function (parentElId, className) {
        var totalWid = 0;
        var els = SeeUtils.getByClass(document.getElementById(parentElId), className);
        if (els.length > 0) {
            for (var num = 0; num < els.length; num++) {
                totalWid += SeeUtils.getElWidth(els[num]);
            }
        }
        return totalWid;
    },
    _getStyleValue: function (elObj, attr) {
        elObj = SeeUtils.getElObj(elObj);
        if (!elObj.nodeType) {
            return void (0);
        }
        var view = elObj.ownerDocument.defaultView;
        if (!view || !view.opener) {
            view = window;
        }
        if (elObj.currentStyle) {
            return elObj.currentStyle[attr];
        }
        else {
            if (view.getComputedStyle != null) {
                return view.getComputedStyle(elObj)[attr];
            }
        }
    },
    isShow: function (elObj) {
        elObj = SeeUtils.getElObj(elObj);
        var display = SeeUtils._getStyleValue(elObj, 'display');
        if (display === 'none') {
            return false;
        }
        else {
            return true;
        }
    },
    indexByTag: function (parentName, tagName, obj) {
        var thEls = SeeUtils.getElByTag(parentName, tagName);
        for (var num = 0; num < thEls.length; num++) {
            var thElObj = thEls[num];
            if (thElObj == obj) {
                return num;
            }
        }
        return -1;
    },
    getElHeight: function (elObj) {
        elObj = SeeUtils.getElObj(elObj);
        if (elObj != null && SeeUtils.isShow(elObj)) {
            if (elObj.style.height != null && elObj.style.height.length > 0 && elObj.style.height != 'auto' && (elObj.style.height + "").indexOf("%") == -1) {
                return parseFloat(elObj.style.height);
            }
            if ((SeeUtils._getStyleValue(elObj, "height") + "").indexOf("%") == -1 && parseFloat(SeeUtils._getStyleValue(elObj, "height")) > 0) {
                return parseFloat(SeeUtils._getStyleValue(elObj, "height"));
            }
            if (elObj.offsetHeight > 0) {
                var borderTopWidth = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "borderTopWidth"));
                var borderBottomWidth = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "borderBottomWidth"));
                var paddingTop = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "paddingTop"));
                var paddingBottom = SeeUtils.getNumber(SeeUtils._getStyleValue(elObj, "paddingBottom"));
                var backHeight = parseFloat(elObj.offsetHeight) - parseFloat(borderTopWidth) - parseFloat(borderBottomWidth) - parseFloat(paddingTop) - parseFloat(paddingBottom);
                return parseFloat(backHeight + '');
            }
            return 0;
        }
        else if (elObj != null) {
            var oldStyle = elObj.getAttribute("style");
            SeeUtils.attrEl(elObj, 'style', "visibility:hidden;display:block !important;" + oldStyle);
            var height = SeeUtils.getElHeight(elObj);
            SeeUtils.attrEl(elObj, 'style', oldStyle);
            return height;
        }
        else {
            return 0;
        }
    },
    setElWidth: function (elObj, width) {
        elObj = SeeUtils.getElObj(elObj);
        if (elObj != null && AssertUtils.isNotEmpty(width)) {
            if ((width + "").indexOf("%") > 0 || width === 'auto') {
                elObj.style.width = width;
            }
            else if (!isNaN(width)) {
                elObj.style.width = parseFloat(width) + "px";
            }
        }
    },
    innerHTMl: function (elObj, htmls) {
        elObj = SeeUtils.getElObj(elObj);
        if (elObj != null) {
            if (SeeUtils.isIE8 || SeeUtils.isIE9 || SeeUtils.isIE10) {
                $(elObj).html(htmls);
            }
            else {
                elObj.innerHTML = htmls;
            }
        }
    },
    setElHeight: function (elObj, height) {
        elObj = SeeUtils.getElObj(elObj);
        if (elObj != null && AssertUtils.isNotEmpty(height)) {
            if ((height + "").indexOf("%") > 0 || height === 'auto') {
                elObj.style.height = height;
            }
            else {
                if (parseFloat(height) >= 0) {
                    elObj.style.height = parseFloat(height) + "px";
                }
            }
        }
    },
    insertAfter: function (newElement, targetElement) {
        targetElement = SeeUtils.getElObj(targetElement);
        if (targetElement == null) {
            return void (0);
        }
        var parent = targetElement.parentNode;
        if (parent.lastChild == targetElement) {
            if (typeof newElement === 'string') {
                var temp = document.createElement('div');
                temp.innerHTML = newElement;
                var frag = document.createDocumentFragment();
                while (temp.firstChild) {
                    frag.appendChild(temp.firstChild);
                }
                parent.appendChild(frag);
            }
            else {
                parent.appendChild(newElement);
            }
        }
        else {
            if (typeof newElement === 'string') {
                var temp = document.createElement('div');
                temp.innerHTML = newElement;
                var frag = document.createDocumentFragment();
                while (temp.firstChild) {
                    frag.appendChild(temp.firstChild);
                }
                parent.insertBefore(frag, targetElement.nextSibling);
            }
            else {
                parent.insertBefore(newElement, targetElement.nextSibling);
            }
        }
    },
    insertBefore: function (newElement, targetElement) {
        targetElement = SeeUtils.getElObj(targetElement);
        if (targetElement == null) {
            return void (0);
        }
        var parent = targetElement.parentNode;
        if (typeof newElement === 'string') {
            var temp = document.createElement('div');
            temp.innerHTML = newElement;
            var frag = document.createDocumentFragment();
            while (temp.firstChild) {
                frag.appendChild(temp.firstChild);
            }
            parent.insertBefore(frag, targetElement);
        }
        else {
            parent.insertBefore(newElement, targetElement);
        }
    },
    appendToBody: function (htmls, winObj) {
        var bodyEls = null;
        if (winObj != null) {
            bodyEls = winObj.document.getElementsByTagName("body");
        }
        else {
            bodyEls = document.getElementsByTagName("body");
        }
        if (typeof htmls === 'string') {
            var temp = document.createElement('div');
            temp.innerHTML = htmls;
            var frag = document.createDocumentFragment();
            while (temp.firstChild) {
                frag.appendChild(temp.firstChild);
            }
            bodyEls[0].appendChild(frag);
            return frag;
        }
        else {
            bodyEls[0].appendChild(htmls);
            return htmls;
        }
    },
    getNumber: function (val) {
        val = parseFloat(val);
        if (AssertUtils.isNumber(val)) {
            return val;
        }
        else {
            return 0;
        }
    },
    prependToBody: function (node, winObj, toEnd) {
        var bodyEls = null;
        if (winObj != null) {
            bodyEls = winObj.document.getElementsByTagName("body");
        }
        else {
            bodyEls = document.getElementsByTagName("body");
        }
        if (bodyEls[0].childNodes.length > 0 && toEnd !== true) {
            if (typeof node === 'string') {
                SeeUtils.prepend(node, bodyEls[0]);
            }
            else {
                bodyEls[0].insertBefore(node, bodyEls[0].childNodes[0]);
            }
        }
        else {
            bodyEls[0].appendChild(node);
        }
    },
    removeChild: function (parentNode, cldNode) {
        parentNode = SeeUtils.getElObj(parentNode);
        if (parentNode == null) {
            return void (0);
        }
        if (cldNode != null) {
            parentNode.removeChild(cldNode);
        }
    },
    showHide: function (elements, show) {
        var elemdisplay = { BODY: "block" };
        var iframe, iframeDoc = null;
        function css_defaultDisplay(nodeName) {
            if (elemdisplay[nodeName]) {
                return elemdisplay[nodeName];
            }
            var id = SeeUtils.getUUid();
            var elm = SeeUtils.appendToBody("<" + nodeName + " id='" + id + "'>");
            display = SeeUtils._getStyleValue(id, "display");
            SeeUtils.removeEl(id);
            if (display === "none" || display === "") {
                var iframeEl = document.createElement("iframe");
                iframeEl.style.frameBorder = 0;
                iframeEl.style.width = 0;
                iframeEl.style.height = 0;
                SeeUtils.appendToBody(iframeEl);
                if (!iframeDoc || !iframe.createElement) {
                    iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;
                    iframeDoc.write("<!doctype html><html><body>");
                    iframeDoc.close();
                }
                elem = iframeDoc.body.appendChild(iframeDoc.createElement(nodeName));
                display = SeeUtils._getStyleValue(elem, "display");
                document.body.removeChild(iframe);
            }
            elemdisplay[nodeName] = display;
            return display;
        }
        function isHidden(elem, el) {
            elem = el || elem;
            return SeeUtils._getStyleValue(elem, "display") === "none";
        }
        var elem, display, values = [], index = 0, length = elements.length;
        for (; index < length; index++) {
            elem = elements[index];
            if (!elem.style) {
                continue;
            }
            if (show) {
                if (!values[index] && elem.style.display === "none") {
                    elem.style.display = "";
                }
                if (elem.style.display === "" && isHidden(elem)) {
                    values[index] = css_defaultDisplay(elem.nodeName);
                }
            }
        }
        for (index = 0; index < length; index++) {
            elem = elements[index];
            if (!elem.style) {
                continue;
            }
            if (!show || elem.style.display === "none" || elem.style.display === "") {
                elem.style.display = show ? values[index] || "" : "none";
            }
        }
        return elements;
    },
    showEl: function (elId) {
        var node = SeeUtils.getElObj(elId);
        if (node != null) {
            return SeeUtils.showHide([node], true);
        }
    },
    getElVal: function (elId) {
        var node = SeeUtils.getElObj(elId);
        if (node != null) {
            return node.value;
        }
    },
    setElVal: function (elId, elValue) {
        var node = SeeUtils.getElObj(elId);
        if (node != null) {
            node.value = elValue;
        }
    },
    hideEl: function (elId) {
        var node = SeeUtils.getElObj(elId);
        if (node != null) {
            node.style.display = "none";
        }
    },
    text: function (elId, text) {
        var node = SeeUtils.getElObj(elId);
        if (node != null) {
            node.innerText = text;
        }
    },
    showElByClass: function (className) {
        var els = SeeUtils.getByClass(document, className);
        if (els.length > 0) {
            for (var num = 0; num < els.length; num++) {
                SeeUtils.showEl(els[num]);
            }
        }
    },
    hideElByClass: function (clsName, winObj) {
        var els = [];
        if (winObj != null) {
            els = SeeUtils.getByClass(winObj.document, clsName);
        }
        else {
            els = SeeUtils.getByClass(document, clsName);
        }
        if (els.length > 0) {
            for (var num = 0; num < els.length; num++) {
                SeeUtils.hideEl(els[num]);
            }
        }
    },
    getElByTagAndIndex: function (oParent, tagName, index) {
        var selecteEls = SeeUtils.getElByTag(oParent, tagName);
        for (var selNums = 0; selNums < selecteEls.length; selNums++) {
            var selecteElObj = selecteEls[selNums];
            if (parseFloat(index) === selNums) {
                return selecteElObj;
            }
        }
        return null;
    },
    removeEl: function (node) {
        node = SeeUtils.getElObj(node);
        if (node != null) {
            if (node.parentNode) {
                node.parentNode.removeChild(node);
            }
        }
    },
    html: function (curNode, html) {
        curNode = SeeUtils.getElObj(curNode);
        if (curNode != null) {
            curNode.innerHTML = html;
        }
    },
    attrByClass: function (className, attName, attrValue, winObj) {
        var els = null;
        if (winObj != null) {
            els = SeeUtils.getByClass(winObj.document, className);
        }
        else {
            els = SeeUtils.getByClass(document, className);
        }
        if (els.length > 0) {
            for (var num = 0; num < els.length; num++) {
                SeeUtils.attrEl(els[num], attName, attrValue);
            }
        }
    },
    removeAttrEl: function (node, attName) {
        node = SeeUtils.getElObj(node);
        if (node != null) {
            node.removeAttribute(attName);
        }
    },
    attrEl: function (node, attName, attrValue) {
        node = SeeUtils.getElObj(node);
        if (node != null) {
            node.setAttribute(attName, attrValue);
        }
        if (node != null && attName === 'value' && node.tagName === 'INPUT') {
            node.value = attrValue;
        }
    },
    getAttrEl: function (node, attName) {
        node = SeeUtils.getElObj(node);
        if (node != null) {
            return node.getAttribute(attName);
        }
    },
    cssByClass: function (className, cssName, cssValue, winObj) {
        var els = null;
        if (winObj != null) {
            els = SeeUtils.getByClass(winObj.document, className);
        }
        else {
            els = SeeUtils.getByClass(document, className);
        }
        if (els.length > 0) {
            for (var num = 0; num < els.length; num++) {
                SeeUtils.css(els[num], cssName, cssValue);
            }
        }
    },
    getCss: function (elId, cssName) {
        var node = SeeUtils.getElObj(elId);
        var returnVal = null;
        if (node != null) {
            returnVal = node.style[cssName];
            if (!AssertUtils.isNotEmpty(returnVal)) {
                returnVal = SeeUtils._getStyleValue(node, cssName);
            }
        }
        return returnVal;
    },
    css: function (elId, cssName, cssValue, winObj) {
        var node = SeeUtils.getElObj(elId, winObj);
        if (node != null && cssValue != null && (cssValue + "").indexOf("undefined") < 0) {
            cssValue = cssValue + "";
            if (cssName == "width" || cssName == "height" || cssName == "left" || cssName == "right" || cssName == "top" || cssName == "bottom" || cssName == "maxWidth" || cssName == "maxHeight") {
                if (cssValue != null && cssValue.length > 0 && cssValue.indexOf("%") < 0 && cssValue != "auto" && cssValue != "none") {
                    cssValue = (cssValue + "").split("px")[0] + "px";
                }
            }
            if (cssValue != null) {
                try {
                    node.style[cssName] = cssValue;
                }
                catch (e) {
                }
            }
        }
        return this;
    },
    cssByJson: function (elId, cssJson, winObj) {
        var node = SeeUtils.getElObj(elId, winObj);
        if (node != null) {
            for (var cssName in cssJson) {
                SeeUtils.css(elId, cssName, cssJson[cssName]);
            }
        }
    },
    prepend: function (curNode, parentNodeId) {
        var pNode = SeeUtils.getElObj(parentNodeId);
        if (pNode.childNodes[0] != null) {
            if (pNode == null || curNode == null) {
                return void (0);
            }
            if (typeof curNode === 'string') {
                var temp = document.createElement('div');
                temp.innerHTML = curNode;
                var frag = document.createDocumentFragment();
                while (temp.firstChild) {
                    pNode.insertBefore(temp.firstChild, pNode.childNodes[0]);
                }
                pNode.insertBefore(frag, pNode.childNodes[0]);
            }
            else {
                pNode.insertBefore(curNode, pNode.childNodes[0]);
            }
        }
        else {
            SeeUtils.appendTo(curNode, parentNodeId);
        }
    },
    appendTo: function (curNode, parentNodeId) {
        var pNode = SeeUtils.getElObj(parentNodeId);
        if (pNode == null || curNode == null) {
            return void (0);
        }
        if (typeof curNode === 'string') {
            var temp = document.createElement('div');
            temp.innerHTML = curNode;
            var frag = document.createDocumentFragment();
            while (temp.firstChild) {
                frag.appendChild(temp.firstChild);
            }
            pNode.appendChild(frag);
        }
        else {
            if (pNode.nodeType === 1 || pNode.nodeType === 11) {
                if (curNode instanceof jQuery) {
                    if (curNode.get(0) != null) {
                        pNode.appendChild(curNode.get(0));
                    }
                }
                else {
                    pNode.appendChild(curNode);
                }
            }
        }
    },
    getUUid: function () {
        function S4() {
            return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
        }
        return ("id_" + S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
    },
    addEvent: function (eventNode, funName, eventFun) {
        eventNode = SeeUtils.getElObj(eventNode);
        if (eventNode != null && typeof eventNode == 'object') {
            if (eventNode.attachEvent) {
                if (funName != null && funName.indexOf("on") < 0) {
                    funName = "on" + SeeUtils.changeFirstCharToLow(funName);
                }
                eventNode.attachEvent(funName, eventFun);
            }
            else if (eventNode.addEventListener) {
                eventNode.addEventListener(funName, eventFun, false);
            }
        }
    },
    removeEvent: function (eventNode, funName, eventFun) {
        eventNode = SeeUtils.getElObj(eventNode);
        if (eventNode == null) {
            return void (0);
        }
        if (eventFun == null) {
            eventFun = function () {
            };
        }
        if (eventNode.detachEvent) {
            if (funName != null && funName.indexOf("on") < 0) {
                funName = "on" + SeeUtils.changeFirstCharToLow(funName);
            }
            eventNode.detachEvent(funName, eventFun);
        }
        else if (eventNode.removeEventListener) {
            eventNode.removeEventListener(funName, eventFun, false);
        }
    },
    changeFirstCharToUpp: function (str) {
        var firstChar = str.substring(0, 1);
        var afterChar = str.substring(1);
        str = firstChar.toUpperCase() + afterChar;
        return str;
    },
    changeFirstCharToLow: function (str) {
        if (AssertUtils.isNotEmpty(str)) {
            var firstChar = str.substring(0, 1);
            var afterChar = str.substring(1);
            str = firstChar.toLowerCase() + afterChar;
            return str;
        }
    },
    getWindowHeight: function () {
        if (window.innerHeight != undefined) {
            return window.innerHeight;
        }
        else {
            var B = document.body, D = document.documentElement;
            return Math.min(D.clientHeight, B.clientHeight);
        }
    },
    ready: function (fn) {
        if (document.addEventListener) {
            document.addEventListener('DOMContentLoaded', function () {
                document.removeEventListener('DOMContentLoaded', arguments.callee, false);
                fn();
            }, false);
        }
        else if (document.attachEvent) {
            document.attachEvent('onreadystatechange', function () {
                if (document.readyState == 'complete') {
                    document.detachEvent('onreadystatechange', arguments.callee);
                    fn();
                }
            });
        }
    },
    addNodeToHeader: function (addNode) {
        var oHead = document.getElementsByTagName('HEAD').item(0);
        oHead.appendChild(addNode);
    },
    addCssToHeader: function (href) {
        var oHead = document.getElementsByTagName('HEAD').item(0);
        var oScript = document.createElement("link");
        oScript.type = "text/css";
        oScript.href = href;
        oScript.setAttribute('rel', 'stylesheet');
        oHead.appendChild(oScript);
    },
    getHttpRequest: function () {
        if (window.XMLHttpRequest)
            return new XMLHttpRequest();
        else if (window.ActiveXObject)
            return new ActiveXObject("MsXml2.XmlHttp");
    },
    includeJS: function (sId, fileUrl, source) {
        if ((source != null) && (!document.getElementById(sId))) {
            var oHead = document.getElementsByTagName('HEAD').item(0);
            var oScript = document.createElement("script");
            oScript.type = "text/javascript";
            oScript.id = sId;
            oScript.text = source;
            oHead.appendChild(oScript);
        }
    },
    ajaxPage: function (sId, url) {
        var oXmlHttp = SeeUtils.getHttpRequest();
        oXmlHttp.onreadystatechange = function () {
            if (oXmlHttp.readyState == 4) {
                SeeUtils.includeJS(sId, url, oXmlHttp.responseText);
            }
        };
        oXmlHttp.open('GET', url, false);
        oXmlHttp.send(null);
    },
    addScriptToHeader: function (src, callback, synceFlag, jsId) {
        if (synceFlag) {
            SeeUtils.ajaxPage(jsId, src);
        }
        else {
            var oHead = document.getElementsByTagName('HEAD').item(0);
            var oScript = document.createElement("script");
            oScript.type = "text/javascript";
            oScript.src = src;
            var done = false;
            if (callback != null) {
                oScript.onload = oScript.onreadystatechange = function () {
                    if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) {
                        done = true;
                        callback();
                    }
                };
            }
            oHead.appendChild(oScript);
        }
    },
    extend: (function () {
        var isObjFunc = function (name) {
            var toString = Object.prototype.toString;
            return function () {
                return toString.call(arguments[0]) === '[object ' + name + ']';
            };
        };
        var isObject = isObjFunc('Object'), isArray = isObjFunc('Array'), isBoolean = isObjFunc('Boolean');
        return function extend() {
            var index = 0, isDeep = false, obj, copy, destination, source, i;
            if (isBoolean(arguments[0])) {
                index = 1;
                isDeep = arguments[0];
            }
            for (i = arguments.length - 1; i > index; i--) {
                destination = arguments[i - 1];
                source = arguments[i];
                if (isObject(source) || isArray(source)) {
                    for (var property in source) {
                        obj = source[property];
                        if (isDeep && (isObject(obj) || isArray(obj))) {
                            copy = isObject(obj) ? {} : [];
                            var extended = extend(isDeep, copy, obj);
                            destination[property] = extended;
                        }
                        else {
                            destination[property] = source[property];
                        }
                    }
                }
                else {
                    destination = source;
                }
            }
            return destination;
        };
    })()
};
